var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;
var _def_YunEdit = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.showtext = null;
    t.tiptext = null;
    t.pintaiNode = null;
    t.webNode = null;
    t.zilen = 50;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.start = function () {};
  _creator.prototype.onEnable = function () {
    this.showtext.string = "";
    this.tiptext.node.active = true;
    if (window.tt || window.wx) {
      this.pintaiNode.active = true;
      this.webNode.active = false;
    } else {
      this.pintaiNode.active = false;
      this.webNode.active = true;
    }
  };
  _creator.prototype.onDisable = function () {};
  _creator.prototype.onClickEdit = function () {
    if (window.tt) {
      this.onJianPanShuru(window.tt);
    } else {
      window.wx && this.onJianPanShuru(window.wx);
    }
  };
  _creator.prototype.onJianPanShuru = function (e) {
    var t = this;
    e.showKeyboard({
      defaultValue: this.showtext.string,
      maxLength: 50,
      multiple: false,
      confirmHold: false,
      confirmType: "done",
      success: function () {
        t.tiptext.node.active = false;
      }
    });
    e.onKeyboardComplete(function (e) {
      console.log("输入的内容", e.value);
      t.showtext.string = e.value;
      "" == e.value && (t.tiptext.node.active = true);
    });
    e.onKeyboardInput(function (o) {
      console.log("键盘输入的当前值", e.value);
      t.showtext.string = o.value;
      if ("" == o.value) {
        t.tiptext.node.active = true;
      } else {
        t.tiptext.node.active = false;
      }
    });
  };
  _creator.prototype.getNowText = function () {
    if (window.tt || window.wx) {
      return this.showtext.string;
    } else {
      return this.webNode.getComponent(cc.EditBox).string;
    }
  };
  __decorate([_property(cc.Label)], _creator.prototype, "showtext", undefined);
  __decorate([_property(cc.Label)], _creator.prototype, "tiptext", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "pintaiNode", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "webNode", undefined);
  __decorate([_property()], _creator.prototype, "zilen", undefined);
  return __decorate([_ccclass], _creator);
}(cc.Component);
exports.default = _def_YunEdit;